package cn.gson.springboot.model.pojos;

import javax.persistence.*;
import java.sql.Date;
import java.util.Objects;

@Entity
@Table(name = "customercare_", schema = "crm")
public class Customercare {
    private int customercareId;
    private String customercareTheme;
    private Date customercareDate;
    private String customercareContent;
    private Integer customercareType;
    private String customercareFeedback;
    private String customercareRemarks;
    private String customercareContactName;
    private Customer customerByCustomerId;
    private Employee employeeByEmpId;

    @Id
    @Column(name = "customercare_id", nullable = false)
    public int getCustomercareId() {
        return customercareId;
    }

    public void setCustomercareId(int customercareId) {
        this.customercareId = customercareId;
    }



    @Basic
    @Column(name = "customercare_theme", nullable = true, length = 255)
    public String getCustomercareTheme() {
        return customercareTheme;
    }

    public void setCustomercareTheme(String customercareTheme) {
        this.customercareTheme = customercareTheme;
    }

    @Basic
    @Column(name = "customercare_date", nullable = true)
    public Date getCustomercareDate() {
        return customercareDate;
    }

    public void setCustomercareDate(Date customercareDate) {
        this.customercareDate = customercareDate;
    }

    @Basic
    @Column(name = "customercare_content", nullable = true, length = 255)
    public String getCustomercareContent() {
        return customercareContent;
    }

    public void setCustomercareContent(String customercareContent) {
        this.customercareContent = customercareContent;
    }

    @Basic
    @Column(name = "customercare_type", nullable = true)
    public Integer getCustomercareType() {
        return customercareType;
    }

    public void setCustomercareType(Integer customercareType) {
        this.customercareType = customercareType;
    }

    @Basic
    @Column(name = "customercare_feedback", nullable = true, length = 255)
    public String getCustomercareFeedback() {
        return customercareFeedback;
    }

    public void setCustomercareFeedback(String customercareFeedback) {
        this.customercareFeedback = customercareFeedback;
    }

    @Basic
    @Column(name = "customercare_remarks", nullable = true, length = 255)
    public String getCustomercareRemarks() {
        return customercareRemarks;
    }

    public void setCustomercareRemarks(String customercareRemarks) {
        this.customercareRemarks = customercareRemarks;
    }

    @Basic
    @Column(name = "customercare_contact_name", nullable = true, length = 255)
    public String getCustomercareContactName() {
        return customercareContactName;
    }

    public void setCustomercareContactName(String customercareContactName) {
        this.customercareContactName = customercareContactName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Customercare that = (Customercare) o;
        return customercareId == that.customercareId &&
                Objects.equals(customercareTheme, that.customercareTheme) &&
                Objects.equals(customercareDate, that.customercareDate) &&
                Objects.equals(customercareContent, that.customercareContent) &&
                Objects.equals(customercareType, that.customercareType) &&
                Objects.equals(customercareFeedback, that.customercareFeedback) &&
                Objects.equals(customercareRemarks, that.customercareRemarks) &&
                Objects.equals(customercareContactName, that.customercareContactName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(customercareId, customercareTheme, customercareDate, customercareContent, customercareType, customercareFeedback, customercareRemarks, customercareContactName);
    }

    @ManyToOne
    @JoinColumn(name = "customer_id", referencedColumnName = "customer_id")
    public Customer getCustomerByCustomerId() {
        return customerByCustomerId;
    }

    public void setCustomerByCustomerId(Customer customerByCustomerId) {
        this.customerByCustomerId = customerByCustomerId;
    }

    @ManyToOne
    @JoinColumn(name = "emp_id", referencedColumnName = "emp_id")
    public Employee getEmployeeByEmpId() {
        return employeeByEmpId;
    }

    public void setEmployeeByEmpId(Employee employeeByEmpId) {
        this.employeeByEmpId = employeeByEmpId;
    }
}
